<meta charset="UTF-8">
<style>
#f_3{
	padding:40px; 
	padding-top: 10px;
}
</style>
<div class="modal-header">
	
	<h3 class="modal-title">日期停课</h3>
</div>
<br/>

<div id="f_3">
	<form id="f_myForm">
		<div class="input-group col-md-6"
			style="float: left; padding: 0px 10px 20px 0px;">
			<span class="input-group-addon">请选择停课日期</span> 
			<input type="text" class="form-control" name="suspendTime" placeholder="请选择停课日期" id="f_laydate1" />
			<span class="glyphicon glyphicon-calendar form-control-feedback" style="margin-right: 10px;"></span>
		</div>
	</form>
</div>
<br/>
<div class="modal-footer">
	<button type="button" class="btn btn-success" data-dismiss="modal" id="f_formButton">
		<span class="glyphicon glyphicon-ok"></span>提交
	</button>
</div>
<script>
$(function(){
	//layui日期插件
	laydate.render({
	  	elem: '#f_laydate1',
	  	calendar: true,    //开启公历节日,标明节日
	  	min:minDate()
	});
});
$('#f_formButton').click(function(){
	var laydate=$("#f_laydate1").val();
	if(laydate==""){
		bootbox.alert("请选择停课日期！");
		return false;
	}
	var serial=$("#f_myForm").serialize();
	$(this).attr('disabled',true);
	$.ajax({
	    type: 'post',
	    url: 'ttb/g_btn1_rqtk',
	    data: serial,
	    success: function(data) {
	    	bootbox.alert(data.msg);
	    	$('#f_formButton').removeAttr('disabled');
	    },error:function(data){
	    	bootbox.alert(data.msg);
	    }
	});
});
//设置最小可选的日期
function minDate(){
    var now = new Date();
    return now.getFullYear()+"-" + (now.getMonth()+1) + "-" + now.getDate();
 }
</script>
